//
//  DictionaryUtility.m
//  HSBCHybrid
//
//  Created by PCQ on 10/02/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "DictionaryUtility.h"


@implementation DictionaryUtility

+ (NSMutableDictionary *) indexKeyedDictionaryFromArray:(NSArray *)array 
{
	
	NSMutableDictionary *mutableDictionary = [[NSMutableDictionary alloc] init];
	for (int i=0; i+1 < [array count]; i = i+2) { 
        //DBG v0.986 check for plus one in case off number of values returned (e.g malformed params containing = or &) this would cause a crash, now app will try to run with what it has
		[mutableDictionary setObject:[[array objectAtIndex:i+1] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding] forKey:[array objectAtIndex:i]];
	}
	
	return mutableDictionary;
}

@end
